    function showpopup(GrpID) {
        var popUrl = 'testcase_categories.aspx?GrpID=' + GrpID;
        showPopWin(popUrl, 800, 500, null);
    }
    
    function openExcelDocPath(strLocation, boolReadOnly) {
		var objExcel;
		objExcel = new ActiveXObject("Excel.Application");
		objExcel.Visible = true;
		objExcel.Workbooks.Open(strLocation, false, boolReadOnly);
	}

	function OpenQTPWin(uidbatch,flowt) {
	    var left = (screen.width / 2) - (350 / 2);
	    var top = (screen.height / 2) - (400 / 2);
	    window.open("OpenQTP.aspx?uidbatch=" + uidbatch + "&FlowType=" +flowt , "windowname3", 'width=350 height=400 target=_top top='+top+', left='+left);
	    //var url="OpenQTP.aspx?uidbatch=" + uidbatch + "&FlowType=" + flowt;
        //showPopWin(url, 800, 500, null);
        return false;
    }
        
    function DisplayHelp() {
        showPopWin("frameworkhelp.aspx", 800, 500, null);
        return false;
    }

    function DisplayResults(BatchName, FlowType) {
        showPopWin("BatchResults.aspx?BatchName=" + BatchName + "&FlowType=" + FlowType, 850, 500, null);
        return false;
    }
    
        function clickButton(e, buttonid) {
        var evt = e ? e : window.event;
        var bt = document.getElementById(buttonid);

        if (bt) {
            if (evt.keyCode == 13) {
                bt.click();
                return false;
            }
        }
    }
    
     function selectAll(hdnDelID) {
      var allElts = document.forms['aspnetForm'].elements;
      var i,flag;
        var chkelts=new Array();
        var j=0; 
        for (i=0; i<allElts.length; i++) {
        var elt = allElts[i];
        if (elt.type == "checkbox") 
        {        
            chkelts[j]=elt.id;
            j=j+1;    
        }
      }
      var masterchkbx = window.document.getElementById(chkelts[0]);
      if(masterchkbx.checked==true)
      {
        for (i=1; i<chkelts.length; i++) 
            {
                var chkbx = window.document.getElementById(chkelts[i]);
                chkbx.checked=true;
                flag=true;
            }
      }
      else
      {
        for (i=1; i<chkelts.length; i++) 
            {
                var chkbx = window.document.getElementById(chkelts[i]);
                chkbx.checked=false;
                flag=false;
            }
      }
      if(flag==true)
      {
          window.document.getElementById(hdnDelID).value = '';
          getSelectedUserIds(hdnDelID);
      }
      else
      {
          window.document.getElementById(hdnDelID).value = '';
      }
    }
    
    function getSelectedUserIds(hdnDelID) {
        var allElts = document.forms['aspnetForm'].elements;
        var i;
        var selectedList = new Array();
        for (i = 0; i < allElts.length; i++) {
            var elt = allElts[i];
            if (elt.type == "checkbox") {
                if (elt.checked) {
                    selectedList[selectedList.length] = elt.id;
            }
        }
    }
        for (j = 0; j < selectedList.length; j++) {
        var trimid = selectedList[j].replace('ctl00_ContentPlaceHolder1_','');
        setCheckedItemsForDel(trimid,hdnDelID);
    }
    return selectedList;
   }
   
    function setCheckedItemsForDel(CheckBoxListClientID,hdnFldId) {
        var sData = window.document.getElementById(hdnFldId).value;
        var where_is_a = sData.indexOf("[" + CheckBoxListClientID + "],");
        if (where_is_a == -1) {
            sData += "[" + CheckBoxListClientID + "],";
        }
        else {
        var sTemp = "[" + CheckBoxListClientID + "],";
        sData = sData.replace(sTemp, "");
    }
     window.document.getElementById(hdnFldId).value = sData;
   }
   
   function setCheckedItems(CheckBoxListClientID, imgid,hdnTestId) 
    {
    var sData = window.document.getElementById(hdnTestId).value;
    var where_is_a = sData.indexOf("[" + CheckBoxListClientID + "],");
    if (where_is_a == -1) {
        sData += "[" + CheckBoxListClientID + "],";
        if (imgid != '')
        { document.getElementById(imgid).style.visibility = "visible"; }
    }
    else {
        var sTemp = "[" + CheckBoxListClientID + "],";
        sData = sData.replace(sTemp, "");
        if (imgid != '')
        { document.getElementById(imgid).style.visibility = "visible"; }
    }
    window.document.getElementById(hdnTestId).value = sData;
}

    function deleteallcheck(hdnCntrlId)
    {
        if (window.document.getElementById(hdnCntrlId).value == '') {
            alert("No batch selected!!");
            return false;
        }
        else {
            if (!confirm('Are you sure to delete selected batch(es) ? Current batch data will be lost.')) {
                return false;
            }
            else {
                return true;
            } 
        }
    }